﻿namespace DynamicGeometry
{
    public class LineTwoPoints : LineBase, ILine
    {
        public override PointPair OnScreenCoordinates
        {
            get
            {
                return Math.GetLineFromSegment(Coordinates, CanvasLogicalBorders);
            }
        }

#if !PLAYER

        [PropertyGridVisible]
        [PropertyGridName("Convert to ray")]
        public void ConvertToRay()
        {
            var ray = Factory.CreateRay(this.Drawing, this.Dependencies);
            ray.Style = this.Style;
            Actions.ReplaceWithNew(this, ray);
        }

        [PropertyGridVisible]
        [PropertyGridName("Convert to segment")]
        public void ConvertToSegment()
        {
            var segment = Factory.CreateSegment(this.Drawing, this.Dependencies);
            segment.Style = this.Style;
            Actions.ReplaceWithNew(this, segment);
        }

#endif

    }
}